package com.hlcl.huaji.ctrl;

import com.elcl.support.userage.domain.BaseSimpleItem;
import com.hlcl.huaji.R;
import com.hlcl.huaji.model.Confing;
import com.hlcl.huaji.model.LoginResponse;
import com.hlcl.huaji.model.LoginResult;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lichunlin on 2018/5/23.
 */

public class MineCtrl {

    private String[] order = new String[]{"全部", "待处理", "处理中", "已完成", "已评价"};
    private int[] orderImg = new int[]{R.mipmap.ic_mine_order_all, R.mipmap.ic_mine_order_todo, R.mipmap.ic_mine_order_ing
            , R.mipmap.ic_mine_order_finish, R.mipmap.ic_mine_order_comment};

    //获取订单
    public List<BaseSimpleItem> getOrderListBean() {
        List<BaseSimpleItem> orders = new ArrayList<>();
        for (int i = 0; i < order.length; i++) {
            BaseSimpleItem baseSimpleItem = new BaseSimpleItem();
            baseSimpleItem.setContent(order[i]);
            baseSimpleItem.setImg_recourse(orderImg[i]);
            baseSimpleItem.setType((byte) 2);
            orders.add(baseSimpleItem);
        }
        return orders;
    }

    private String[] mine_deal = new String[]{"收益", "地址管理", "常见问题", "咨询客服"};
    private int[] img_mine_deal = new int[]{R.mipmap.ic_mine_income, R.mipmap.ic_mine_address
            , R.mipmap.ic_mine_question, R.mipmap.ic_mine_kefu};

    //获取个人中心下面的操作
    public List<BaseSimpleItem> getMineListBean(LoginResponse loginResult, Confing confing) {
        List<BaseSimpleItem> orders = new ArrayList<>();
        for (int i = 0; i < mine_deal.length; i++) {
            BaseSimpleItem baseSimpleItem = new BaseSimpleItem();
            baseSimpleItem.setContent(mine_deal[i]);
            baseSimpleItem.setImg_recourse(img_mine_deal[i]);
            if (i == 0) {//收益的钱数
                int money = 0;
                if (null != loginResult) {
                    money = loginResult.getIncome();
                }
                baseSimpleItem.setRemark(money + "元 提现");
            } else if (i == 3) {//电话
                String phone = "";
                if (null != confing) {
                    phone = confing.getPhone();
                }
                baseSimpleItem.setRemark(phone);
            }
            orders.add(baseSimpleItem);
        }
        return orders;
    }


}
